package com.ydzh.kfqgwvisitor.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ydzh.kfqgwvisitor.annotation.SysLog;
import com.ydzh.kfqgwvisitor.base.Result;
import com.ydzh.kfqgwvisitor.service.BeDepartmentService;
import com.ydzh.kfqgwvisitor.vo.BeDepartmentVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 被访人部门信息表  前端控制器
 * </p>
 *
 * @author zcj
 * @since 2021-09-01
 */
@RestController
@RequestMapping("/beDepartment")
@Api(tags = "部门")
public class BeDepartmentController {
    @Autowired
    private BeDepartmentService beDepartmentService;


    @SysLog("部门集合")
    @ApiOperation(value = "部门集合")
    @ApiOperationSupport(order = 1)
    @GetMapping("/unitList/{unitId}")
    public Result<BeDepartmentVO> unitList(@ApiParam(name = "unitId", value = "单位的ID", required = true) @PathVariable("unitId") Integer unitId) {
        return Result.buildSuccess(beDepartmentService.findByUnitId(unitId));
    }


}

